package com.gperp.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.gperp.common.GPResult;
import com.gperp.common.StringUtils;
import com.gperp.pojo.Result;
import com.gperp.service.AsKeywordsService;

@Controller
public class AsKeywordsController {

	@Resource
	private AsKeywordsService asKeywordsService;
	
	//包含分页，模糊查询	
	@RequestMapping(value="selectlikeKeywords",method=RequestMethod.POST)
	@CrossOrigin
	@ResponseBody
	public Result selectlikeKeywords(Integer page,Integer rows,String keywords){
		//调用服务查询商品列表
		Result list=asKeywordsService.getlikeKeywords(page, rows, keywords);
		return list;
	}
	
	@RequestMapping(value="operate",method=RequestMethod.GET)
	@CrossOrigin
	@ResponseBody
	public GPResult operate(String data){
		return asKeywordsService.checkCode(StringUtils.getGetString(data));
	}
	
	@RequestMapping(value="selectmoney",method=RequestMethod.GET)
	@CrossOrigin
	@ResponseBody
	public List selectmoney(Long id){
		return asKeywordsService.selectkeywordsmoney(id);
	}
	
	@RequestMapping(value="selecttypeyear",method=RequestMethod.GET)
	@CrossOrigin
	@ResponseBody
	public List selecttypeyear(){
		return asKeywordsService.selecttypeyear();
	}
	
}
